package com.guge.sports.service.impl;

import com.guge.sports.entity.Dto.Option;
import com.guge.sports.entity.Dto.StStudentDto;
import com.guge.sports.entity.StStudent;
import com.guge.sports.mapper.StStudentMapper;
import com.guge.sports.service.StStudentService;
import com.guge.sports.toolPackage.base.BaseService;
import com.guge.sports.toolPackage.utils.MyPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author testjava
 * @since 2022-09-14
 */
@Service
public class StStudentServiceImpl extends BaseService<StStudent> implements StStudentService {

    @Autowired
    private StStudentMapper stStudentMapper;

    @Override
    public List<Option> getGoStateTimeList() {
        return stStudentMapper.getGoStateTimeList();
    }

    @Override
    public List<Option> getGoSchoolYearList() {
        return stStudentMapper.getGoSchoolYearList();
    }

    @Override
    public MyPager<StStudentDto> selectStTeacherPage(MyPager<StStudentDto> myPager, StStudentDto student) {
        Integer count = stStudentMapper.selectCountStStudentPage(student);
        myPager.setTotalCount(count);
        List<StStudentDto> studentDtos = stStudentMapper.selectStStudentPage(myPager.calcuStartIndex(), student);
        myPager.setList(studentDtos);
        return myPager;
    }
}
